﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DHT.Data
{
    public class DHT
    {
        byte[] iD = new byte[20];

        /// <summary>
        /// this client id
        /// </summary>
        public byte[] ID
        {
            get { return iD; }
            set { iD = value; }
        }

        public byte[] CreateNewID()
        {
            byte[] id = new byte[160];
            string tmp = DateTime.Now.Ticks.ToString();
            byte[] btmp = StringUtils.SHA1(tmp);

            tmp = System.Net.Dns.GetHostName();
            btmp = StringUtils.SHA1(tmp);

            return id;
        }

    }
}
